Dataset Previews
First, initialize by adding tools and declare floating type
using GriddingMachine
using Plots
using Plots.PlotMeasures
ENV["GKSwstype"]="100";
FT = Float32;Then, define a function to plot the dataset
function preview_data(ds::GriddedDataset{FT}, ind::Int)
# preview data
return heatmap(view(ds.data,:,:,ind)',
origin="lower",
aspect_ratio=1,
xticks=[],
yticks=[],
c=:viridis,
size=(700,300),
framestyle=:none)
end
function preview_data(ds::GriddedDataset{FT}, ind::Int, clim::Tuple)
# preview data
return heatmap(view(ds.data,:,:,ind)',
origin="lower",
aspect_ratio=1,
xticks=[],
yticks=[],
c=:viridis,
clim=clim,
size=(700,300),
framestyle=:none)
endpreview_data (generic function with 2 methods)
Canopy height
CHT_LUT = load_LUT(CanopyHeightGLAS{FT}());
CHT_LUT = regrid_LUT(CHT_LUT, Int(size(CHT_LUT.data,2)/180));
preview_data(CHT_LUT, 1)
Clumping index
# global clumping index
CLI_LUT = load_LUT(ClumpingIndexMODIS{FT}(), "12X", "1Y");
CLI_LUT = regrid_LUT(CLI_LUT, Int(size(CLI_LUT.data,2)/180));
mask_LUT!(CLI_LUT, FT[0,1]);
preview_data(CLI_LUT, 1, (0.4,1));Downloading artifact: clumping_index_12X_1Y [?25l#=#=# curl: (22) The requested URL returned error: 404 Not Found [1A[2K[?25hDownloading artifact: clumping_index_12X_1Y [?25l#=#=# ##O#- # ##O=# # #=#=-# # -#O#- # # 1.2% #### 6.0% ############## 20.5% ############################################# 63.6% ######################################################################## 100.0% [1A[2K[?25h
# global clumping index per PFT
CLI_LUT = load_LUT(ClumpingIndexPFT{FT}());
CLI_LUT = regrid_LUT(CLI_LUT, Int(size(CLI_LUT.data,2)/180));
mask_LUT!(CLI_LUT, FT[0,1]);
anim = @animate for i ∈ 1:size(CLI_LUT.data,3)
preview_data(CLI_LUT, i, (0.4,1));
end
gif(anim, fps=1)Gross primary productivity
# MPI GPP
anim = @animate for year ∈ 2001:2019, i ∈ 1:46
GPP_LUT = load_LUT(GPPMPIv006{FT}(), year, "1X", "8D");
preview_data(GPP_LUT, i, (0,10));
end
gif(anim, fps=20)